<template>
    <div class='videoBox'>
        <div class="list">
            <div class="mod" v-for="(v, i) in mvstatus" :key="v.data.id" @click="playVideo(v.data.id)">
                <div class="vBox">
                    <h3>{{ i + 1 }}</h3>
                    <img :src="v.data.coverUrl" alt="" class="vImg">
                    <p>{{ v.data.name }}</p>
                </div>
                <div class="mod-r">
                    <van-icon color="#aaa" name="play-circle-o" />
                    <van-icon color="#aaa" name="ellipsis" />
                </div>
            </div>
        </div>
    </div>
</template>

<script>
import { getvideo } from "@/api/index"
import { mapState } from "vuex"
export default {
    name: 'resent-video',
    data() {
        return {
            mvstatus: []
        }
    },
    computed: {
        ...mapState(['cookie'])
    },
    components: {},
    created() { },
    mounted() { },
    async beforeMount() {
        var { data } = await getvideo(this.cookie)
        let mvstatus = data.data.list
        mvstatus.forEach((v) => {
            if (v.resourceType == 'MV') {
                this.mvstatus.push(v)
            }
        })
        console.log(this.mvstatus);
    },
    methods: {
        playVideo(id) {
            this.$router.push({ name: 'playVideo', params: { id: id } })
        }
    }
}
</script>
<style scoped>
hr {
    width: 98%;
    background: #eee;
    margin: 0 auto;
}

p {
    margin: 5px;
}

h3 {
    font-weight: normal;
    color: #1989fa;
    margin: 5px;
    font-size: 16px;
}

.vBox {
    display: flex;
}

.vBox>p {
    font-size: 12px;
}

.vImg {
    width: 40%;
    margin-left: 15px;
}

.tit {
    padding: 50px 20px 0;

}

.list {
    padding: 0 10px;
}

.mod-p {
    font-size: 12px;
}

.mod-r {
    display: flex;
    align-self: center;
}

.box>.title {
    display: flex;
    justify-content: space-between;
}

.box {
    width: 80%;
    margin: 10px auto;
    background-color: #fff;
    border-radius: 15px;
    padding: 10px 20px;
}

.title>button {
    border: 1px solid red;
    border-radius: 20px;
    color: red;
    background-color: #fff;
    font-size: 12px;
}

.mod {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.mod .van-icon {
    margin-left: 30px;
    font-size: 22px;
}
</style>
